<?php
session_start();
require('../conn.php');
require('../functions.php');
require('admin.php');
if ($_POST) {
    $data = [
        'name' => guolv($_POST['name']),
        'type' => guolv($_POST['type']),
        'remark' => guolv($_POST['remark']),
        'state' => guolv($_POST['state']),
    ];
    $res = $mysql->execute("insert into `sharesite`".arr2s($data));
    if($res){
        echo "<script>alert('添加成功');location.href='add_sharesite.php'</script>";
        exit;
    }

} ?>

<?php include('head.php') ?>
<link rel="stylesheet" href="../editor/themes/default/default.css"/>
<link rel="stylesheet" href="../editor/plugins/code/prettify.css"/>
<script src="<?php echo $jquerysite ?>" type="text/javascript"></script>
<script charset="utf-8" src="../editor/kindeditor.js"></script>
<script charset="utf-8" src="../editor/lang/zh_CN.js"></script>
<script charset="utf-8" src="../editor/plugins/code/prettify.js"></script>
<div class="container-fluid">
    <div class="row-fluid">
        <?php
        include('left.php'); ?>
        <div class="span10">
            <h1 class="page-title">分享域名添加</h1>
            <div class="well">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#home" data-toggle="tab">设置</a></li>
                </ul>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <form id="tab" action="add_sharesite.php" method="post">
                            <label>域名：</label>
                            <input type="text" style="width:300px" name="name" value="">
                            <code>如：www.baidu.com（开头不要带http://）</code>
                            <label>类型：</label>
                            <input type="text" style="width:300px" name="type" value="">
                            <label>备注：</label>
                            <input type="text" style="width:300px" name="remark" value="">
                            <label>状态：</label>
                            <select name="state">
                                <option value="0" selected="selected">未使用</option>
                                <option value="1">使用中</option>
                                <option value="2" >微信屏蔽</option>
                                <option value="3">已删除</option>
                            </select>
                            <label></label>
                            <button class="btn btn-primary"><i class="icon-save"></i> 添加</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>

<footer>
    <hr>
    <p class="pull-right"><!--power by right--></p>
    <p><!--power by --></p>
</footer>
<script src="lib/bootstrap/js/bootstrap.js"></script>


</body>
</html>